﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{-include file="`$__PHY_WEB``$__DIR_ADM`/block/meta.tpl"-}
<title>功能列表 - 后台</title>
</head>

<body>
<div class="sAll">

{-include file="`$__PHY_WEB``$__DIR_ADM`/block/header.tpl"-}
{-php-}include(__PHY_WEB.__DIR_ADM."/block/menu.php");{-/php-}
{-include file="`$__PHY_WEB``$__DIR_ADM`/block/menu.tpl" uL=$rNav-}

<div class="sL">
	<div class="sW main">
<!-- <main> -->
{- if $sMsg -}{- include file="`$__PHY_WEB``$__DIR_ADM`/block/message.tpl" -}{- /if -}

<style type="text/css">
<!--
.list p,.edit p { font-weight:bold; }
-->
</style>
{- if 'list'==$sAction -}
<div class="sL list">
	<p>功能列表</p>
	<table>
		<tr class="capt">
			<td>Group</td>
			<td>Name</td>
			<td>Description</td>
			<td><a href="?action=new">新建</a></td>
		</tr>
{-section name=i loop=$rFuncs-}
		<tr>
			<td>{-$rFuncs[i].group_cname|escape:html-}</td>
			<td><a href="{-$rFuncs[i].func_ename-}">{-$rFuncs[i].func_cname|escape:html-}</a></td>
			<td>{-$rFuncs[i].description|td_truncate:50|escape:html-}</td>
			<td><a href="?action=edit&id={-$rFuncs[i].id-}">修改</a></td>
		</tr>
{-/section-}
		<tr class="capt">
			<td>Group</td>
			<td>Name</td>
			<td>Description</td>
			<td><a href="?action=new">新建</a></td>
		</tr>
	</table>
</div>
{- elseif 'edit'==$sAction -}
<div class="sL edit">
	<p>修改信息</p>
	<table>
		<form method="post" action="?">
		<input type="hidden" name="id" value="{-$rFunc.id|escape:html-}" />
		<tr>
			<td class="indc">Link:</td>
			<td>{-$rFunc.func_ename|escape:html-}</td>
		</tr>
		<tr>
			<td class="indc">Group:</td>
			<td><input type="text" name="group_cname" value="{-$rFunc.group_cname|escape:html-}" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">Name:</td>
			<td><input type="text" name="func_cname" value="{-$rFunc.func_cname|escape:html-}" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">Description:</td>
			<td><textarea rows="5" name="description" class="long">{-$rFunc.description|escape:html-}</textarea></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="submit" name="action" value="update" />
				<input type="submit" name="action" value="cancel" />
			</td>
		</tr>
		</form>
	</table>
</div>
{- elseif 'new'==$sAction -}
<div class="sL edit">
	<p>新增功能</p>
	<table>
		<form method="post" action="?">
		<tr>
			<td class="indc">Link:</td>
			<td><input type="text" name="func_ename" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">Group:</td>
			<td><input type="text" name="group_cname" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">Name:</td>
			<td><input type="text" name="func_cname" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">Description:</td>
			<td><textarea rows="5" name="description" class="long"></textarea></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="submit" name="action" value="add" />
				<input type="submit" name="action" value="cancel" />
			</td>
		</tr>
		</form>
	</table>
</div>
{- else -}
sth wrong: no $sAction.
{- /if -}

<!-- </main> -->
	</div>
</div>

{- include file="`$__PHY_WEB``$__DIR_ADM`/block/footer.tpl" -}

</div><!-- end all -->
</body>
</html>
